# -*- coding: utf-8 -*-
# standard
import os
import sys

# third

# local
_P_PATH =  os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if _P_PATH not in sys.path:
    sys.path.append(_P_PATH)
from functions import *


"""
@Title:   
@File: 下载指定的文件.py
@Author: walle 2024年01日16日 10时00分56秒
@Version: 1.0.0
@Desc: 
"""


def main(page_url: str,  need_audio: int = 0):
    key = page_url.split("?v=")[-1].strip()
    kw = {
        "key": key,
        "page_url": page_url,
        "save_path": "34343434",  # 指明了视频的保存路径那么 download_func 就会认为视频已下载过，从而跳过视频的下载
        "audio_path": "",
        "need_audio": need_audio
          }
    resp = download_func(**kw)
    print(resp)


if __name__ == '__main__':
    main(page_url="https://www.youtube.com/watch?v=zvvZEIGNLo0", need_audio=1)
    pass